<template>
    <view class="content">
        <view class="bg"></view>
        <!-- 待审核 -->
        <view class="top" v-if="data.status == 0">
            <image src="../../static/image/dsh.png" class="dsh"></image>
        </view>
        
        <!-- 审核失败 -->
        <view class="top" v-if="data.status == 2">
            <image src="../../static/image/shsb.png" class="shsb"></image>
            <view class="title" v-if="data.reason">
                <image src="../../static/icon/tip.png" class="tip"></image>
                <view>审核失败原因说明</view>
            </view>
            <view class="text" v-if="data.reason">
                <u-parse :html="data.reason"></u-parse>
            </view>
        </view>
        
        <view class="box">
            <view class="item">
                <view>公司名称</view>
                <view class="inp">{{data.corporate_name}}</view>
            </view>
            <view class="item">
                <view>营业执照</view>
                <image :src="data.business_license_uri" class="up" @click="$previewImageSA(data.business_license_uri)"></image>
            </view>
            <!-- <view class="item">
                <view>联系电话</view>
                <view class="inp">13000000001</view>
            </view> -->
        </view>
        
        <!-- 审核失败 -->
        <view class="btn" v-if="data.status == 1 || data.status == 2" @click="$cTo(`/pages/apply/apply?id=${data.id}`)">立即编辑</view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                data: {},
            };
        },
        onLoad() {
            this.getData()
        },
        methods: {
            getData(){
            	this.$ajax('member_auth', {
            		userToken: this.$getSync('userToken'),
            	}).then(ret => {
            		if (ret.status == 0) {
                        this.data = ret.data
            		} else {
            			this.$toast(ret.message);
            		}
            	});
            },
        }
    };
</script>

<style lang="scss">
    page{
        background-color: #f5f5f5;
    }
    .content {
    	padding: 20rpx;
    }
    
    .bg {
    	width: 100%;
    	height: 390rpx;
    	position: absolute;
    	top: 0;
    	left: 0;
    	z-index: -1;
    	background: linear-gradient(to bottom, #00734c, #f5f5f5);
    }
    
    .top{
        padding: 50rpx;
        background-color: #fff;
        border-radius: 20rpx;
        margin-bottom: 20rpx;
    }
    .dsh{
        width: 305rpx;
        height: 250rpx;
        margin: 0 auto;
    }
    .shsb{
        width: 326rpx;
        height: 266rpx;
        margin: 0 auto;
    }
    .title{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        font-size: 28rpx;
        font-weight: bold;
        padding-top: 35rpx;
        padding-bottom: 15rpx;
    }
    .tip{
        width: 34rpx;
        height: 35rpx;
        margin-right: 15rpx;
    }
    .text{
        font-size: 24rpx;
        color: #acacac;
    }
    
    .box{
        padding: 0 25rpx;
        background-color: #fff;
        border-radius: 20rpx;
    }
    .item{
        padding: 30rpx 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2rpx solid #f0f0f0;
    }
    .item:last-child{
        border-bottom: none;
    }
    .inp{
        flex: 1;
        text-align: right;
    }
    .up{
        width: 160rpx;
        height: 160rpx;
        border: 2rpx solid #f0f0f0;
        border-radius: 15rpx;
    }
    
    .btn{
        background-color: #00734c;
        padding: 25rpx;
        border-radius: 50rpx;
        font-size: 34rpx;
        color: #fff;
        text-align: center;
        margin-top: 40rpx;
    }

</style>
